package org.openstreetmap.josm.plugins.cadastre_es;

import java.util.Vector;

import org.openstreetmap.josm.data.osm.Node;

public class VertexContainer {
	private Pixel p;
	private Vector<PolyPixel> vertexs = new Vector<PolyPixel>();
	private Boolean included = false;
    private Node n = null;
	
	public VertexContainer(Pixel p) {
		this.p = new Pixel(p);
		if (p.x() == 609 && p.y() == 220)
			System.out.println("Debug");
	}
	
	public void put(PolyPixel p) {
		vertexs.add(p);
		if (p.x() == 609 && p.y() == 220)
			System.out.println("Debug");
	}
	
	public void remove(PolyPixel p) {
		if (p.x() == 609 && p.y() == 220)
			System.out.println("Debug");
		int index = vertexs.indexOf(p);
		if (index > -1) {
			vertexs.remove(index);
		}
	}
	
	public Pixel getP(){
		return p;
	}
	
	public Vector<PolyPixel> getVertexs() {
		return vertexs;
	}
	
	public boolean isIncluded() {
		return included;
	}
	
	public void setIncluded() {
		included = true;
	}
    
    public void setNode(Node n) {
        this.n = n;
    }
    
    public Node getNode() {
        return n;
    }
}
